package com.jing.android.notes.ui.service;

import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;

public class InitService extends JobIntentService {

    public static final int JOB_ID = 1;

    private static final String TAG = InitService.class.getSimpleName();

    public InitService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        return super.onBind(intent);
    }

    @Override
    protected void onHandleWork(@NonNull Intent intent) {
        Log.i(TAG, "handleWork start");
        int count = 100;
        for (int i = 0; i < count; i++) {
            Log.i(TAG, "handleWork:" + i);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        Log.i(TAG, "handleWork end");
    }
}